from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# 根据title进行断言
driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.get('http://www.baidu.com')
# 定位搜索框
serach_box = driver.find_element_by_id('kw')
# 输入内容
serach_box.send_keys("python")
# 调用回车
serach_box.send_keys(Keys.ENTER)
time.sleep(3)
print(driver.title)
